<!doctype html>
<html lang="en" class="fixed">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <title>综合课表</title>
    <link rel="apple-touch-icon" sizes="120x120" href="favicon/apple-icon-120x120.png">
    <link rel="icon" type="image/png" sizes="192x192" href="favicon/android-icon-192x192.png">
    <link rel="icon" type="image/png" sizes="32x32" href="favicon/favicon-32x32.png">
    <link rel="icon" type="image/png" sizes="16x16" href="favicon/favicon-16x16.png">
    <link rel="stylesheet" type="text/css"
          href="<?php xcho(loadSource('/assets/plugins/bootstrap/css/bootstrap.min.css')) ?>">
    <link rel="stylesheet" href="<?php xcho(loadSource('/assets/plugins/animate.css/animate.css')) ?>">
    <link rel="stylesheet" href="<?php xcho(loadSource('/assets/plugins/font-awesome/css/font-awesome.css')) ?>">
    <link rel="stylesheet"
          href="<?php xcho(loadSource('/assets/plugins/data-table/media/css/dataTables.bootstrap.min.css')) ?>">
    <!--    <link rel="stylesheet" href="-->
    <link rel="stylesheet" href="<?php xcho(loadSource('/assets/plugins/layui/css/layui.css')) ?>" media="all">
    <?php //xcho(loadSource('/assets/plugins/ztree/css/zTreeStyle/zTreeStyle.css')) ?><!--">-->
    <link rel="stylesheet" href="<?php xcho(loadSource('/assets/plugins/ztree/css/metroStyle/metroStyle.css')) ?>"
          type="text/css">
    <link rel="stylesheet" href="<?php xcho(loadSource('/app/css/app.css')) ?>">
    <link rel="stylesheet" href="<?php xcho(loadSource('/assets/css/new_main.css')) ?>">
    <style>
        .pagination {
            margin: 0;
        }

        .content-title {
            /*width: 1200px;*/
            padding: 20px;
            background: #fff;
            margin: 0 auto;
        }

        .content-title .title {
            border-bottom: 1px #ccc solid;
            font-size: 0;
        }

        .content-title .title p {
            width: 60px;
            text-align: center;
            font-size: 14px;
            color: #108EE9;
            display: inline-block;
            position: relative;
        }

        .content-title .title p i {
            width: 70px;
            display: inline-block;
            border-bottom: 2px #108EE9 solid;
            position: absolute;
            bottom: -11px;
            left: 0;
        }

        .content-title .status {
            margin-top: 10px;
        }

        .content-title .status p {
            display: inline-block;
            font-size: 12px;
        }

        .content-title .status ul {
            display: inline-block;
        }

        .content-title .status ul li {
            display: inline-block;
            font-size: 12px;
            margin-left: 15px;
        }

        .content-title .status ul li > input {
            margin-right: 10px;
        }

        .content-title .title ul {
            font-size: 0;
            display: inline-block;
            float: right;
        }

        .content-title .title ul li {
            font-size: 12px;
            display: inline-block;
            margin: 0 8px;
            padding: 4px 10px;
            background: rgba(16, 142, 233, .6);
            border-radius: 5px;
            color: #fff;
            cursor: pointer;
        }

        .content-title .title ul li:hover {
            background: #1ab394;
        }
        .content-title .range {
            margin-top: 10px;
        }

        .layui-form-item {
            display: inline-block;
        }

        .content-title .range .layui-form-item label {
            font-size: 12px;
            padding: 6px;
            background: #FBFBFB;
            border: 1px #E8E8E8 solid;
            margin-left: 8px;
            width: initial;
        }

        .layui-form-checkbox i {
            margin-right: 6px;
        }

        .layui-form-item label.labelDate {
            float: none;
            padding: 6px;
            background: #FBFBFB;
            border: 1px #E8E8E8 solid;
            text-align: center;
        }

        .content-title .range select {
            width: 80px;
            border: 1px #ccc solid;
            font-size: 10px;
            color: #333;
        }

        .content-title .range select option {
            font-size: 10px;
        }

        .content-title .range input {
            width: 110px;
            height: 34px;
            border: none;
            font-size: 12px;
            border: 1px #ccc solid;
            border-left: none;
            text-indent: 6px;
        }

        .content-title .range div {
            display: inline-block;
            margin-bottom: 0;
        }

        .content-title .canal {
            margin-top: 5px;
        }

        .content-title .next select:nth-of-type(1) {
            width: 100px;
        }

        .content-cont {
            /*width: 1200px;*/
            padding: 20px 20px 30px;
            background: #fff;
            margin: 30px auto;
        }

        .content-cont .top_btn .top_more {
            display: inline-block;
            position: relative;
            width: 200px;
        }

        .content-cont .top_btn .top_more button {
            padding: 4px 16px;
            border: none;
            border-radius: 6px;
            font-size: 12px;
            background: #eee;
        }

        .content-cont .top_btn .top_more button b {
            font-size: 10px;
            color: #999;
            margin-left: 4px;
        }

        .content-cont .top_btn .top_more ul {
            width: 100px;
            text-align: center;
            padding: 10px;
            background: #fff;
            box-shadow: 0px 0px 5px #ccc;
            position: absolute;
            top: 0;
            left: 90px;
            display: none;
        }

        .content-cont .top_btn .top_more ul li {
            line-height: 30px;
            cursor: pointer;
        }

        .content-cont .top_btn .top_btnRight {
            float: right;
        }
       /* .content .content-cont .schedule .schedule-title{
            overflow: hidden;
        }*/
        .content-cont .schedule .schedule-title table {
            width: 100%;
            margin-top: 10px;
        }

      /*  .content-cont .schedule .schedule-title table {
            width: 100000px;
        }
        .content-cont .schedule table tbody{
            width: 1118px;
        }
        .content-cont .schedule table tbody tr{
            float: left;
        }*/

        .content-cont .table table thead tr th {
            padding: 4px;
            background: #1ab394;
            color: #fff;
            text-align: center;
        }

        .content-cont .table table thead tr th:nth-of-type(1) span {
            display: inline-block;
            width: 12px;
            height: 12px;
            border: 1px #888 solid;
            background: #fff;
            margin-right: 20px;
            position: relative;
            cursor: pointer;
        }

        .content-cont .table table thead tr th:nth-of-type(1) span b {
            position: absolute;
            left: 28%;
            top: -60%;
        }

        .content-cont .table table thead tr th:nth-of-type(7) {
            width: 170px;
        }

        .content-cont .table table tbody tr {
            border-bottom: 1px #ccc solid;
        }

        .content-cont .table table tbody tr:nth-of-type(even) {
            background: rgba(238, 238, 238, .5);
        }

        .content-cont .table table tbody tr td {
            padding: 8px;
            border-bottom: 1px #eee solid;
            text-align: center;
        }

        .content-cont .table table tbody tr td:nth-of-type(2) {
            color: #108EE9;
        }

        .content-cont .table table tbody tr td:last-child span {
            margin: 0 5px;
            color: #777;
            position: relative;
            cursor: pointer;
        }

        .content-cont .table table tbody tr td:last-child span b {
            width: 80px;
            line-height: 24px;
            background: #fff;
            position: absolute;
            bottom: -25px;
            left: -15px;
            font-weight: normal;
            font-size: 10px;
            color: #000;
            border: 1px #ccc solid;
            border-radius: 5px;
            display: none;
        }

        .content-cont .bottom_pages {
            padding: 3px 15px;
            height: 30px;
            margin-top: 8px;
            background: #fff;
            font-size: 0;
        }

        .content-cont .schedule .schedule-btn {
            float: right;
            margin-bottom: 10px;
        }

        .content-cont .schedule h4 {
            display: inline-block;
            margin-left: 200px;
        }

        .content-cont .schedule table thead tr {
            border-bottom: 3px #eee solid;
        }

        .content-cont .schedule table thead tr th {
            text-align: center;
            padding: 10px 0;
        }

        .content-cont .schedule table tbody tr span {
            color: #333;
        }

        .content-cont .schedule table tbody tr span b {
            padding: 4px 8px;
            font-weight: normal;
            font-size: 12px;
            color: #fff;
            background: #1ab394;
            border-radius: 5px;
        }

        .content-cont .schedule table tbody tr ul {
            margin-top: 6px;
            padding: 4px 10px;
            text-align: left;
        }

        .content-cont .schedule table tbody tr td:nth-of-type(even) ul:nth-of-type(odd) {
            background: rgba(238, 238, 238, .5);
        }

        .content-cont .schedule table tbody tr td:nth-of-type(odd) ul:nth-of-type(even) {
            background: rgba(238, 238, 238, .5);
        }

        .content-cont .schedule table tbody tr td {
            vertical-align: initial;
            padding: 10px 0;
            text-align: center;
        }

        .content-cont .schedule table tbody tr td span {
            width: 100%;
            display: inline-block;
            background: rgba(16, 142, 233, .6);
            color: #fff;
            padding: 10px 10px;
        }

        .content-cont .schedule table tbody tr td ul li {
            line-height: 24px;
            font-size: 12px;
        }

        .content-cont .schedule table tbody tr td ul li:nth-of-type(3) {
            color: #108EE9;
        }
        .layui-input{
            border-radius: 0;
        }
        .loopBtn #loopText{
            width: 80px;
            line-height: 28px;
            vertical-align: middle;
        }
        .loopBtn #left-loop>button,#right-loop>button{
            width: 40px;
            height:28px;
            background: #fff;
            border:1px #ccc solid;
        }
        .loopBtn #loopText:hover{
            background: #fff;
            color:#000;
        }
        .content .top_pages ul{
            float: inherit;
        }
    </style>
</head>

<body><?php include_once TPL_PATH . 'public/nav.phtml'; ?>
<div class="">
    <div class="page-body" style="padding: 0">
        <div >
            <div class="">
                <form action="<?php xcho($sSearchAction) ?>" id="zhList">
                    <div class="class-box">
                        <div class="class-box-head">
                            <div class="class-box-title">
                                <h3 class="col-md-8">综合课表</h3>
                                <div class="input-group col-md-4">
                                    <input class="form-control" type="text" id="teacher" name="teacher" value="<?php xcho($aSearch['teacher']) ?>"
                                   placeholder="可搜索教师名">
                                </div>
                            </div>
                        </div>
                        <div class="class-box-title">
                            <div class="layui-form status">
                                <div class="filter-content col-xs-6 col-sm-3 form-container form-inline form-container-noborder">
                                    <div class="checkbox-group">
                                        <div class="checkboxes range">
                                            <?php foreach ($aSubject as $aTmp) { ?>
                                                <input type="checkbox" title="<?php xcho($aTmp['cn_name']) ?>"
                                                       name="subject[<?php xcho($aTmp['dict_value']) ?>]"
                                                       value="<?php xcho($aTmp['dict_value']) ?>"
                                                    <?php if (in_array($aTmp['dict_value'], $aSearch['subject'])) { ?>
                                                        checked="checked"
                                                    <?php } ?>>
                                            <?php } ?>

                                        </div>
                                    </div>
                            </div>
                            <div class="col-xs-6 col-sm-3 form-container form-inline">
                                <div class="layui-form-item form-group">
                                    <label class="labelDate layui-form-label">日期：</label>
                                </div>
                                <div class="layui-inline form-group"> <!-- 注意：这一层元素并不是必须的 -->
                                    <input type="text" class="layui-input" value="<?php xcho($aSearch['start_time']) ?>"
                                           id="start_time" name="start_time" placeholder="年/月/日">
                                </div>
                                <div class="layui-inline form-group"> <!-- 注意：这一层元素并不是必须的 -->
                                    <input type="text" class="layui-input" value="<?php xcho($aSearch['end_time']) ?>"
                                           id="end_time" name="end_time" placeholder="年/月/日">
                                </div>
                            </div>
                            <div class="btns-group">
                                <button id="search" class="btn btn-primary btn-sm" url="<?php xcho($sSearchAction) ?>" class="layui-btn layui-btn-small">
                                    确定
                                </button>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
            <div class="content-cont">
                <div class="schedule">
                    <div class="schedule-title">
                        <div class="top_pages schedule-btn">
                            <ul>
                                <?php xchoHtml($aOCourseTeacher->render()) ?>
                            </ul>
                            <!--<ul class="loopBtn">
                                <li id="left-loop"><button><i class="layui-icon">&#xe603;</i></button></li>
                                <li id="loopText"></li>
                                <li id="right-loop"><button><i class="layui-icon">&#xe602;</i></button></li>
                            </ul>-->
                            <?php if(isset($add_url)){?>
                                <a class="layui-btn layui-btn-warm" href=" <?php xcho($add_url) ?>">添加日程</a>
                            <?php } ?>
                        </div>
                        <table>
                            <tbody>
                            <?php if (empty($aCourseLessons)) { ?>
                                <tr>
                                    <td>
                                    </td>
                                    <?php foreach ($aOCourseTeacher as $iTeacherID) { ?>
                                        <?php foreach ($aCourseTeachers as $aCourseTeacher) { ?>
                                            <?php if ($iTeacherID['id'] == $aCourseTeacher['teacher_id']) { ?>
                                                <td>
                                                    <span>
                                                        <?php xcho($aCourseTeacher['teacher_name']) ?><br>
                                                        <?php xcho('0节课'); ?>
                                                    </span>
                                                </td>
                                            <?php } ?>
                                        <?php } ?>
                                    <?php } ?>
                                </tr>
                            <?php } else {
                                foreach ($aCourseLessons as $sDay => $aCourseLesson) { ?>
                                    <tr>
                                        <td>
                                            <span><?php xcho($sDay) ?><br><?php xcho($aCourseLesson['week']) ?></span>
                                        </td>
                                        <?php foreach ($aOCourseTeacher as $iTeacherID) { ?>
                                            <?php foreach ($aCourseTeachers as $aCourseTeacher) { ?>
                                                <?php if ($iTeacherID['id'] == $aCourseTeacher['teacher_id']) { ?>
                                                    <?php if (isset($aCourseLesson[$iTeacherID['id']])) { ?>
                                                        <td>
                                                            <span>
                                                                <?php xcho($aCourseTeacher['teacher_name']) ?><br>
                                                                <?php if (isset($aCourseLesson[$iTeacherID['id']])) {
                                                                    $iNum = 0;
                                                                    foreach ($aCourseLesson[$iTeacherID['id']] as $aTmpo) {
                                                                        if (isset($aTmpo['id'])) {
                                                                            ++$iNum;
                                                                        }
                                                                    }
                                                                    if ($iNum != 0) {
                                                                        xcho($iNum . '节课');
                                                                    }
                                                                }?>
                                                            </span>
                                                            <?php foreach ($aCourseLesson[$iTeacherID['id']] as $aTmp) { ?>

                                                                <ul <?php if(isset($aTmp['ctype']) && $aTmp['ctype'] == 'audition') {?> style="background:rgba(165, 125, 126, 0.5)" <?php }?>>
                                                                    <?php if (isset($aTmp['id'])) { ?>
                                                                        <li>
                                                                            <a href="<?php xcho($aTmp['student_url']) ?>">
                                                                                <?php xcho($aTmp['sname']??"") ?>
                                                                            </a>
                                                                        </li>
                                                                        <li>
                                                                            <?php xcho($aTmp['times'] . $aTmp['arrange_status']) ?>
                                                                        </li>
                                                                        <li>
                                                                            <a href="<?php xcho($aTmp['course_url']) ?>">
                                                                                <?php xcho($aTmp['cname']??"") ?>
                                                                            </a>
                                                                        </li>
                                                                        <?php
                                                                    } else { ?>
                                                                        <li>

                                                                            <a href="<?php xcho($aTmp['syllabus_url']??'') ?>">
                                                                                <?php xcho($aTmp['topic']) ?>
                                                                            </a>
                                                                        </li>
                                                                        <li>
                                                                            <?php xcho($aTmp['times']) ?>
                                                                        </li>
                                                                        <?php
                                                                    } ?>
                                                                </ul>
                                                            <?php } ?>
                                                        </td>
                                                    <?php } else { ?>
                                                        <td>
                                                        <span>
                                                            <?php xcho($aCourseTeacher['teacher_name']) ?><br>
                                                            <?php xcho('0节课'); ?>
                                                        </span>
                                                        </td>
                                                    <?php } ?>
                                                <?php } ?>
                                            <?php } ?>
                                        <?php } ?>
                                    </tr>
                                <?php }
                            } ?>
                            </tbody>
                        </table>
                        <div class="top_pages schedule-btn">
                            <ul>
                                <?php xchoHtml($aOCourseTeacher->render()) ?>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
<input type="hidden" id="tempString" name="tempString"/>
<script src="<?php xcho(loadSource('/assets/plugins/jquery/jquery.min.js')) ?>"></script>
<script src="<?php xcho(loadSource('/assets/plugins/layui/layui.all.js')) ?>" charset="utf-8"></script>
<script src="<?php xcho(loadSource('/assets/plugins/bootstrap/js/bootstrap.min.js')) ?>"></script>
<script src="<?php xcho(loadSource('/assets/plugins/data-table/media/js/jquery.dataTables.min.js')) ?>"></script>
<script src="<?php xcho(loadSource('/assets/plugins/data-table/media/js/dataTables.bootstrap.min.js')) ?>"></script>
<script src="<?php xcho(loadSource('/assets/plugins/layer-v3.0.3/layer/layer.js')) ?>"></script>
<script
        src="<?php xcho(loadSource('/assets/plugins/data-table/extensions/Responsive/js/dataTables.responsive.min.js')) ?>"></script>
<script
        src="<?php xcho(loadSource('/assets/plugins/data-table/extensions/Responsive/js/responsive.bootstrap.min.js')) ?>"></script>
<script src="<?php xcho(loadSource('/assets/plugins/ztree/js/jquery.ztree.core.js')) ?>"></script>
<script type="text/javascript"
        src="<?php xcho(loadSource('/assets/plugins/ztree/js/jquery.ztree.excheck.js')) ?>"></script>
<script type="text/javascript"
        src="<?php xcho(loadSource('/assets/plugins/ztree/js/jquery.ztree.exedit.js')) ?>"></script>
<script>
    //综合列表轮播
   /* $(function () {
        var index = 0;
        var tableW = $(".schedule-title").width()-120;
        var number = Math.ceil($(".schedule-title").width()/116),numbers = number,numbera = 0;
        var trlength = $(".schedule-title table tr td").length+10;
        console.log(trlength);
        $("#loopText").text("1-"+number);
        $('#right-loop>button').click(function () {
             if(numbers > trlength){
                 $(this).attr("disabled");
              }else{
                 numbers += number;
                 numbera = numbers - number;
                 $("#left-loop").find("button").removeAttr("disabled");
                 $("#loopText").text(numbera+"-"+numbers);
                 index++;
                 selectPic(index);
              }
        })
        $('#left-loop>button').click(function () {
            //console.log(number);
            numbers -= number;
            numbera = numbers - number;
            //console.log(numbera);
            if(numbera < 0){
                numbera=1;
                numbers=number;
                $("#loopText").text("1-"+number);
                $(this).attr("disabled",true);

            }else{
                $("#right-loop").find("button").attr("disabled",false);
                $("#loopText").text(numbera+"-"+numbers);
                if (index == 0) {
                    index = $(".schedule-title table tr").length-1;
                    $(".schedule-title table").css("left", -index * tableW+"px");
                }
                index--;
                selectPic(index);
            }
        })
        function selectPic(index) {
            $(".schedule-title table").animate({
                marginLeft: -index * tableW+"px",
            }, 600, function() {
                //检查是否到最后一张
                var len = $(".schedule-title table tr").length-1;
                if (index == len ) {
                    index %= 8;
                    $(".schedule-title table").css("left", "0px");
                }
            })
        }
    })*/
    $(function () {
        "use strict";
        layui.use(['layer', 'form'], function () {
            var layer = layui.layer
                , form = layui.form;
        });
        layui.use('laydate', function () {
            var laydate = layui.laydate;

            //执行一个laydate实例
            laydate.render({
                elem: '#start_time', //指定元素
            });
            //执行一个laydate实例
            laydate.render({
                elem: '#end_time', //指定元素
            });
        });
        //搜索-form表单提交
        $("#search").click(function () {
            $("#zhList").submit();
        });
    });
</script>
<?php include_once TPL_PATH . 'public/foot_script.phtml'; ?>
<button id="top" style="height: 50px;width: 50px;"></button></body>

</html>
